/*

Copyright (C) 2010 Hans-Werner Hilse <hilse@web.de>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

*/

package de.hilses.droidreader;

import java.lang.String;
import java.nio.ByteBuffer;

/**
 * An instance of this class will provide font file names, reading from Preferences
 */
interface FontProvider {
	/**
	 * callback that is used to retrieve font file names
	 * @param fontName the name of the font to load
	 * @param collection the collection of fonts (CID)
	 * @param flags font flags as understood by the MuPDF library
	 * @return file name with full path
	 */
	String getFontFile(String fontName, String collection, int flags);

	/**
	 * callback that is used to retrieve a buffer containing font data
	 * @param fontName the name of the font to load
	 * @param collection the collection of fonts (CID)
	 * @param flags font flags as understood by the MuPDF library
	 * @return allocated ByteBuffer filled with the font data
	 */
	ByteBuffer getFontBuffer(String fontName, String collection, int flags);

	/**
	 * callback that is used to retrieve a buffer containing charmap (CMap) data
	 * @param cmapName charmap to load
	 * @return allocated ByteBuffer filled with the cmap data
	 */
	ByteBuffer getCMapBuffer(String cmapName);
}

